
<html>
<head>
<script type="text/javascript" src="loadxmldoc.js"></script>
</head>
<body>

<script type="text/javascript">
xmlDoc=loadXMLDoc("books.xml");

x=xmlDoc.documentElement.childNodes;
for (i=0;i<x.length;i++)
{ 
if (x[i].nodeType==1)
  {//Process only element nodes (type 1) 
  document.write(x[i].nodeName);//book la node cap 1, co ten la book, khong co gia tri!
  document.write("<br />");
  
  y=x[i].childNodes;
  for (j=0;j<y.length;j++)
	{ 
	if (y[j].nodeType==1)
	  {//Process only element nodes (type 1) 
	  document.write(y[j].childNodes[0].nodeValue);//node con cua book,title, author cos gia tri
	  document.write("<br />");
	  
	  } 
	}
  } 
}


</script>
</body>
</html>